<template>
	<view class="page">
		<div class="myUnit">
			<div class="titleDiv" @click="detailShow=!detailShow">
				<uni-section title="订单信息" type="line"></uni-section>
				<u-icon name="arrow-down" v-if="!detailShow"></u-icon>
				<u-icon name="arrow-up" v-if="detailShow"></u-icon>
			</div>
			<div class="myText">
				<div>生产单号：</div>
				<div>{{form.orderNo||'-'}}</div>
			</div>
			<div class="myText">
				<div>关联单号：</div>
				<div>{{form.reOrderNo||'-'}}</div>
			</div>
			<div class="myText">
				<div>客户姓名：</div>
				<div>{{form.customerName||'-'}}</div>
			</div>
			<div class="myText">
				<div>订单状态：</div>
				<div>{{form.orderStatusDesc||'-'}}</div>
			</div>
			<div v-if="detailShow">
				<div class="myText">
					<div>商品名称：</div>
					<div>{{form.productName||'-'}}</div>
				</div>
				<div class="myText">
					<div>生成来源：</div>
					<div>
						<div v-if="form.produceType==1">销售生成</div>
						<div v-if="form.produceType==2">计划生产</div>
					</div>
				</div>
				<div class="myText">
					<div>订单数量：</div>
					<div>{{form.quantity||'-'}}</div>
				</div>
				<div class="myText">
					<div>优先级：</div>
					<div>
						<div v-if="form.priority==1">高</div>
						<div v-if="form.priority==2">中</div>
						<div v-if="form.priority==3">低</div>
					</div>
				</div>
				<div class="myText">
					<div>处理人：</div>
					<div>{{form.createBy||'-'}}</div>
				</div>
				<div class="myText">
					<div>创建时间：</div>
					<div>{{form.createTime||'-'}}</div>
				</div>
			</div>
		</div>
		<div class="myUnit">
			<uni-section title="规格信息" type="line"></uni-section>
			<div class="myText">
				<div>商品规格：</div>
				<div>{{form.skuDescCn||'-'}}</div>
			</div>
		</div>
		<div class="myUnit">
			<uni-section title="操作信息" type="line"></uni-section>
			<div v-for="val in form.recordVoList" style="margin: 10px 0; border-bottom: 2px solid #f3f4f5;">
				<div class="myText">
					<div>工序名称：</div>
					<div>{{val.operStepName||'-'}}</div>
				</div>
				<div class="myText">
					<div>操作人：</div>
					<div>{{val.workerName||'-'}}</div>
				</div>
				<div class="myText">
					<div>操作结果：</div>
					<div>{{val.result||'-'}}</div>
				</div>
				<div class="myText">
					<div>操作时间：</div>
					<div>{{val.createTime||'-'}}</div>
				</div>
			</div>
		</div>
	</view>
</template>

<script>
	import {
		getOrder,
	} from "@/api/orderMng/index.js"
	export default {
		data() {
			return {
				detailShow: true,
				form: {}
			}
		},
		onLoad(e) {
			this.load(e.id)
		},
		methods: {
			load(id) {
				uni.showLoading()
				getOrder(id).then(res => {
					this.form = res.data
				})
			}
		}
	}
</script>
<style scoped lang="scss">
	.titleDiv {
		display: flex;
		justify-content: space-between;
	}

	.aBtn {
		color: #0275a1 !important;
	}

	.myText div:nth-child(1) {
		min-width: 80px;
	}

	.myText2 div:nth-child(1) {
		min-width: 80px;
	}

	.unitDiv {
		padding-bottom: 10px;
		border-bottom: 2px dashed #f3f4f5;
	}


	.myText2 {
		width: 50%;
		display: inline-block;
	}

	.myText2 div {
		display: inline-block;
	}

	.myUnit .myText2:nth-child(even) {
		text-align: right;
	}
</style>